// function say(name: string, age: number): string {
//   return `我是${name}，我${age}岁，我喜欢写代码`
// }

// let result = say("张三", 21)
// console.log(result)

//参数可选
function say(name: string, age?: number): string {
  return `我是${name}，我喜欢写代码`
}

// let result = say("张三", 21)
// console.log(result)


/*定义函数*/
const fn = (a: number, b: number): number => {
  return a + b
}

const fn1: (a: number, b: number) => number = (a, b) => {
  return a + b
}

let result = fn1(100,200)
console.log(result)